import Vue from 'vue';
/***验证判断 ****/
Vue.directive('valid',{
  update(el:Element,binding:{value:boolean|null|string,oldValue:boolean|null|string}){
    const cls = el.className.split(' ').filter(m=>(m!='is-success'&&m!='is-error'));
    const add = binding.value==null?'':((typeof binding.value)=='boolean'?'is-success':'is-error');
    cls.push(add);
    el.className = cls.join(' ');
  }
})